#include <exception>
#include "operation.h"

double OperationAdd::GetResult(double x, double y)
{
    return x + y;
}

double OperationSub::GetResult(double x, double y)
{
    return x - y;
}

double OperationMul::GetResult(double x, double y)
{
    return x * y;
}

double OperationDiv::GetResult(double x, double y)
{
    if (y == 0) {
        std::cout << "The second number can't be zero." << std::endl;
        exit(-1);
    }
    return x / y;
}